<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>024-阻止事件冒泡.html</title>
	<style>
		*{
			margin: 0;
			padding: 0;
		}
		.gf{
			width: 500px;
			height: 500px;
			border: 1px solid #000;
			margin: 50px auto;
		}
		.f{
			width: 300px;
			height: 300px;
			margin: 100px auto;
			border: 1px solid #000;
			background-color: red;
		}
		.s{
			width: 100px;
			height: 100px;
			margin: 100px auto;
			background-color: yellow;
		}
	</style>
</head>
<body>
	<div class="gf">
		<div class="f">
			<div class="s"></div>
		</div>
	</div>
</body>
<script src="js/jquery-1.12.4.js"></script>
<script>
	$(function(){
		$('.s').on('click',function(ev){
			alert('s');
			// return false;
			// console.log(ev);
			// ev.stopPropagation();
		});
		$('.f').on('click',function(ev){
			alert('f');
			// return false;
			ev.stopPropagation();
		});
		$('.gf').on('click',function(){
			alert('gf');
		})
	})
</script>
</html>